package com.glela.platform.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.glela.dao.AdConfigDao;
import com.glela.platform.model.response.ResponseAdConfig;
import com.glela.platform.model.AdConfig;
import com.glela.platform.service.AdConfigService;

/**
 * 
 * @author liujie
 * 2016年3月30日
 */
@Service
public class AdConfigServiceImpl implements AdConfigService {
	
	@Autowired
	private AdConfigDao adConfigDao;
	
	public List<ResponseAdConfig> findAll2Response(){
		List<AdConfig> list = adConfigDao.selectAll();
		List<ResponseAdConfig> data = new ArrayList<ResponseAdConfig>();
		if(list!=null){
			for(AdConfig adConfig:list){
				data.add(new ResponseAdConfig(adConfig));
			}
		}
		return data;
	}
}